<aside id="sidebar">
    <div class='panel'>
        <% if (typeof user !== 'undefined' || current_user) { %>
            <div class='header'>
                <span class='col_fade'>个人信息</span>
            </div>
            <div class='inner'>
                <%- include('./user/card.html', { user: typeof user === 'undefined' ? current_user : user }) %>
            </div>
            <% } else { %>
                <div class='inner'>
                    <p>
                        <%= config.description %>
                    </p>

                    <div>
                        您可以
                        <a href='/login'>登录</a> 或
                        <a href='/register'>注册</a> , 也可以
                        <a href="/github">
                        <span class="span-info">
                            通过 GitHub 登录
                        </span>
                        </a>
                    </div>
                </div>
                <% } %>
    </div>

    <% if (current_user) { %>
        <div class="panel">
            <div class='inner'>
                <a href='/topic/create' id='create_topic_btn'>
        <span class='span-success'>发布话题</span>
      </a>
            </div>
        </div>
        <% } %>

            <% if (!current_user || !current_user.isAdvanced) { %>
                <%- include ./_ads.html %>
                    <% } %>

                        <% if (typeof no_reply_topics !== 'undefined') { %>
                            <div class='panel'>
                                <div class='header'>
                                    <span class='col_fade'>无人回复的话题</span>
                                </div>
                                <div class='inner'>
                                    <% if (no_reply_topics.length > 0) { %>
                                        <ul class="unstyled">
                                            <% no_reply_topics.forEach(topic => { %>
                                                <%- include('./topic/small.html', { topic }) %>
                                                    <% }) %>
                                        </ul>
                                        <% } else { %>
                                            <p>无</p>
                                            <% } %>
                                </div>
                            </div>
                            <% } %>

                                <% if (typeof tops !== 'undefined') { %>
                                    <div class='panel'>
                                        <div class='header'>
                                            <span class='col_fade'>积分榜</span> &nbsp;
                                            <a class='dark' href='/users/top100'>TOP 100 &gt;&gt;</a>
                                        </div>
                                        <div class='inner'>
                                            <% if (tops.length > 0) { %>
                                                <ol>
                                                    <% tops.forEach(user => { %>
                                                        <%- include('user/top.html', { user }) %>
                                                            <% }) %>
                                                </ol>
                                                <% } else { %>
                                                    <p>无</p>
                                                    <% } %>
                                        </div>
                                    </div>
                                    <% } %>

                                        <div class='panel'>
                                            <div class='header'>
                                                <span class='col_fade'>友情社区</span>
                                            </div>
                                            <div class='inner'>
                                                <ol class="friendship-community">
                                                    <li>
                                                        <a href="https://eggjs.org/" target="_blank">
            <img src="<%- helper.staticFile('/public/images/egg-logo.png') %>">
          </a>
                                                    </li>
                                                    <li>
                                                        <a href="https://ruby-china.org/" target="_blank">
            <img src="<%- helper.staticFile('/public/images/ruby-china-20150529.png') %>">
          </a>
                                                    </li>
                                                    <div class="sep10"></div>
                                                    <li>
                                                        <a href="http://golangtc.com/" target="_blank">
            <img src="<%- helper.staticFile('/public/images/golangtc-logo.png') %>">
          </a>
                                                    </li>
                                                    <div class="sep10"></div>
                                                    <li>
                                                        <a href="http://phphub.org/" target="_blank">
            <img src="<%- helper.staticFile('/public/images/phphub-logo.png') %>">
          </a>
                                                    </li>
                                                </ol>
                                            </div>
                                        </div>
                                        <div class='panel'>
                                            <div class='header'>
                                                <span class='col_fade'>客户端二维码</span>
                                            </div>
                                            <div class='inner cnode-app-download'>
                                                <img width='200' src="//dn-cnode.qbox.me/FtG0YVgQ6iginiLpf9W4_ShjiLfU">
                                                <br />
                                                <a href="https://github.com/soliury/noder-react-native" target="_blank">客户端源码地址</a>
                                            </div>
                                        </div>
</aside>